package com.qwz.baseJdk;

import java.util.Observable;
import java.util.Observer;

/**
 * @author Qiuwuzhi
 * @version V1.0
 * @Description: 基于jdk的真正的读者
 * @Package com.qwz.example.Reader
 * @date 2019/12/24 10:07
 */
public class Reader implements Observer {
    /**
     * 读者的姓名
     */
    private String name;

    public void update(Observable o,Object object) {
        System.out.println(name + "收到报纸了，阅读，推送的内容是=>" + object);


        System.out.println(name + "收到报纸了，阅读，拉取的内容是=>" + ((NewsPaper) o).getContent());
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
